package com.ruoyi.project.tool.swagger;

import com.ruoyi.framework.config.ConfigMapsConfig;
import com.ruoyi.framework.web.controller.BaseController;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * swagger 用户测试方法
 *
 * @author ruoyi
 */
@Api("用户信息管理")
@RestController
@RequestMapping("/test")
public class DemoController extends BaseController {
    @Autowired
    private ConfigMapsConfig configMapsConfig;

    @GetMapping("/health")
    public String health() {
        return "success";
    }

    @GetMapping("/hello")
    public String hello() {
        return configMapsConfig.getName()
                + " ["
                + new SimpleDateFormat().format(new Date())
                + "]";
    }

}

